
var api = require('../../utils/api.js');
var app = getApp();


Page({

    /**
     * 页面的初始数据
     */
    data: {
        latitude:'',
        longitude:'',
        info:[],
        show:1,
        lists:[]
    },

    gohere(){
        var info=this.data.info;

        console.log(info.lat,info.lng)
        
        var lat=parseFloat(info.lat) ;
        var lng=parseFloat(info.lng) ;
        wx.openLocation({
            latitude: lat,
            longitude: lng,
            scale: 18,
            address: info.address
          })
    },
    callmobile(){
        var mobile=this.data.info.c_mobile;

        wx.makePhoneCall({
          phoneNumber: mobile,
        })
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        var that=this;

        this.setData({
            id:options.id
        })

        api.post({
            url: 'client/getinfobyid',
            data: {id:options.id},
            success: data => {
               console.log(data);

               that.setData({
                   info:data.data
               })

            }
        });


    },


    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {
        var that=this;
        var id=this.data.id;
        api.post({
            url: 'client/getseelogbyidone',
            data: {id:id},
            success: data => {
               console.log(data);
               that.setData({
                   lists:data.data
               })

            }
        });
  
    },

    getmyseelog(){

    },

    setshow(ret){
        console.log(ret);

        var i=ret.currentTarget.dataset.i;

        this.setData({
            show:i
        })
    },
    setinfo(){

        var id=this.data.info.id;
        wx.navigateTo({
          url: '/pages/list/edit?id='+id
        })

    },
    seeclient(){
        var id=this.data.info.id;
        wx.navigateTo({
          url: '/pages/list/seeclint?id='+id
        })
    }


})